 How 
  to simulate a Stepper Motor in EDWinXP?
How 
  to simulate a Stepper Motor in EDWinXP?
A stepper motor is a motor which rotates by making 
  angular steps. Here a unipolar motor is given. It can be used in various applications.
   
   
  
The different parameters of the Stepper motor 
  are>
 
   Internal 
    resistance
 Internal 
    resistance
   Maximum 
    supply voltage
 Maximum 
    supply voltage
   Minimum 
    supply voltage
 Minimum 
    supply voltage
   Maximum 
    Current through coil
 Maximum 
    Current through coil
   Minimum 
    Current for exciting coil
 Minimum 
    Current for exciting coil
 
The different components used in this circuit 
  are
  1. 8051 Microcontroller
  2. ULN2001A – Darlington Array
  3. Stepper Motor
  4. DC Voltage Source
 
  
A clock generator signal is fed to the XTAL pin of 
  the microcontroller. Here a repeatable pattern with low 50n and high 50n is 
  supplied.
   
  
The source code for 8051 – microcontroller 
  is as given below
#include<8051.h> // This header file is included 
  for all 8051 projects.
  #define DELAY 10
  void Delay(int Time);
  void main()
  {
  repeat: // This loop is given to repeat the sequence outputting 
  into the stepper motor.
  P2= 1; // Port2 outputting the sequence 0001
  Delay(DELAY);
  P2= 2; // Port2 outputting the sequence 0010
  Delay(DELAY);
  P2= 4; // Port2 outputting the sequence 0100
  Delay(DELAY);
  P2= 8; // Port2 outputting the sequence 1000
  Delay(DELAY);
  goto repeat; // Repeat the sequence
  }
  // Delay function is to provide delay between two steps.
  void Delay(int Time)
  {
  while (Time--);
  }